package com.wjk.kylin.core.common.oss;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.io.File;

@Component
public class OSSServerImpl<T extends OSSFileModel> implements OSSServer <T> {

    @Autowired
//    @Qualifier("fastDFSServer")
    @Qualifier("localFileServer")
    private OSSServer ossServer;

//    public OSSServerImpl(OSSServer ossServer){
//        this.ossServer = ossServer;
//    }


    @Override
    public String uploadFile(T fileModel) {
        return ossServer.uploadFile(fileModel);
    }

    @Override
    public void deleteFile(String filePath) {
        ossServer.deleteFile(filePath);
    }

    @Override
    public File downloadFile(String filePath) {
        return ossServer.downloadFile(filePath);
    }
}
